package com.example;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by yijy on 2017/7/25.
 */
public class ReplaceTest {
    public static void main(String[] args) {
        ReplaceTest replaceTest= new ReplaceTest();
//        replaceTest.replaceTest1("bbbwillbbb");
//        replaceTest.splitTest("abc");
//        replaceTest.ListBySort();
        replaceTest.Str_subString("http://www.biqudu.com/11_11643/");
    }

    public void replaceTest1(String s){
        s= s.replace(s.substring(3),"hhtccc");
        System.out.println(s);
    }

    public void splitTest(String s1){
        String[] c = s1.split("");
        String c1="";
        for(int i=c.length;i>=1;i--){
            c1=c1+c[i-1];
        }
        System.out.println(c1);
    }

    public void ListBySort(){
        List list = new ArrayList();
        list.add(1);
        list.add(3);
        list.add(2);
        list.add(4);
        for(int i=0;i<list.size();i++){
            System.out.println(list.get(i));
        }
        System.out.println(Arrays.toString(list.toArray())+"----"+list.size());
    }

    public void Str_subString(String s2){
        int s = s2.indexOf("com");
        System.out.println(s);
        s2 =s2.substring(s2.indexOf("com"),s2.length());
        s2 = s2.substring(s2.indexOf("/")+1);
        System.out.println(s2);
    }
}
